Excel - tisk

Otázka od: Vlastimil Zdenek

10. 11. 2003 11:10

Zdravim vsechny!
Poradte prosim, jak vytisknu excelovsky soubou vytvoreny v delphi?
Delam ho takto:
var
  WBk: _Workbook;
  Excel : TExcelApplication;
begin
  Excel := TExcelApplication.Create(Application);
  Excel.ConnectKind := ckNewInstance;
  WBK := Excel.Workbooks.Open(NewSoubor, EmptyParam, EmptyParam,
                                EmptyParam, EmptyParam, EmptyParam,
                                EmptyParam, EmptyParam, EmptyParam,
                                EmptyParam, EmptyParam, EmptyParam,
                                EmptyParam, 0);
naplnim.............

WBK.Save(0);

Excel.TISK <==== tady asi tisknout, al jak..?

WBK.Close(True,Soubor,0,0);
Excel.Free;

end;

Diky moc.
Vlasta

D5 Ent, Excel2000







----------
* www.inMail.sk - Vasa emailova adresa na cely zivot ZDARMA
* Mail neobsahuje virusy. Zkontrolovane antivirusom NOD32 (www.eset.sk)
* www.SlovakNET.sk - profesionalny webhosting, domena .SK ZADARMO
* Zoner Media Explorer 5 - stiahnite si pomocnika pre digitalnu fotografiu
(zme.zoner.sk)

Odpovedá: kexo

10. 11. 2003 11:29

Excel.ActiveWorksheet.Printout

vytah z excelovskeho helpu VBA:
PrintOut Method
Prints the object.

Syntax

expression.PrintOut(From, To, Copies, Preview, ActivePrinter, PrintToFile,
Collate, PrToFileName)

expression Required. An expression that returns an object in the Applies
To list.

>From Optional Variant. The number of the page at which to start printing.
If this argument is omitted, printing starts at the beginning.

To Optional Variant. The number of the last page to print. If this
argument is omitted, printing ends with the last page.

Copies Optional Variant. The number of copies to print. If this argument
is omitted, one copy is printed.

Preview Optional Variant. True to have Microsoft Excel invoke print
preview before printing the object. False (or omitted) to print the object
immediately.

ActivePrinter Optional Variant. Sets the name of the active printer.

PrintToFile Optional Variant. True to print to a file. If PrToFileName is
not specified, Microsoft Excel prompts the user to enter the name of the
output file.

Collate Optional Variant. True to collate multiple copies.

PrToFileName Optional Variant. If PrintToFile is set to True, this
argument specifies the name of the file you want to print to.

Remarks

"Pages" in the descriptions of From and To refers to printed pages - not
overall pages in the sheet or workbook.

kexo

----- Original Message -----
From: "Vlastimil Zdenek" <delphi@gestore.cz>
Subject: Excel - tisk


> Zdravim vsechny!
> Poradte prosim, jak vytisknu excelovsky soubou vytvoreny v delphi?






----------
* www.inMail.sk - Vasa emailova adresa na cely zivot ZDARMA
* Mail neobsahuje virusy. Zkontrolovane antivirusom NOD32 (www.eset.sk)
* www.SlovakNET.sk - profesionalny webhosting, domena .SK ZADARMO
* Zoner Media Explorer 5 - stiahnite si pomocnika pre digitalnu fotografiu
(zme.zoner.sk)

Odpovedá: Vlastimil Zdenek

10. 11. 2003 12:33

Diky. Vsechno vypada OK az na parametr "ActivePrinter". Jak ji zjistim??

Vlasta

----- Original Message -----
From: "kexo" <kexo@ynet.sk>
To: <delphi-l@clexpert.cz>
Sent: Monday, November 10, 2003 11:21 AM
Subject: Re: Excel - tisk


> Excel.ActiveWorksheet.Printout
>
> vytah z excelovskeho helpu VBA:
> PrintOut Method
> Prints the object.
>
> Syntax
>
> expression.PrintOut(From, To, Copies, Preview, ActivePrinter, PrintToFile,
> Collate, PrToFileName)
>
> expression Required. An expression that returns an object in the Applies
> To list.
>
> >From Optional Variant. The number of the page at which to start
printing.
> If this argument is omitted, printing starts at the beginning.
>
> To Optional Variant. The number of the last page to print. If this
> argument is omitted, printing ends with the last page.
>
> Copies Optional Variant. The number of copies to print. If this argument
> is omitted, one copy is printed.
>
> Preview Optional Variant. True to have Microsoft Excel invoke print
> preview before printing the object. False (or omitted) to print the object
> immediately.
>
> ActivePrinter Optional Variant. Sets the name of the active printer.
>
> PrintToFile Optional Variant. True to print to a file. If PrToFileName
is
> not specified, Microsoft Excel prompts the user to enter the name of the
> output file.
>
> Collate Optional Variant. True to collate multiple copies.
>
> PrToFileName Optional Variant. If PrintToFile is set to True, this
> argument specifies the name of the file you want to print to.
>
> Remarks
>
> "Pages" in the descriptions of From and To refers to printed pages - not
> overall pages in the sheet or workbook.
>
> kexo
>
> ----- Original Message -----
> From: "Vlastimil Zdenek" <delphi@gestore.cz>
> Subject: Excel - tisk
>
>
> > Zdravim vsechny!
> > Poradte prosim, jak vytisknu excelovsky soubou vytvoreny v delphi?
>
>
>
>
>
>







----------
* www.inMail.sk - Vasa emailova adresa na cely zivot ZDARMA
* Mail neobsahuje virusy. Zkontrolovane antivirusom NOD32 (www.eset.sk)
* www.SlovakNET.sk - profesionalny webhosting, domena .SK ZADARMO
* Zoner Media Explorer 5 - stiahnite si pomocnika pre digitalnu fotografiu
(zme.zoner.sk)

Odpovedá: kexo

10. 11. 2003 13:21

je to textovy retazec - nazov tlaciarne na ktoru sa ma tlacit.
inymi slovami, ked vyvolas TPrintDialog, alebo TPrinterSetupDialog, kde si
nastavis vystupnu tlaciaren; tak nazov vybranej tlaciarne najdes v
Printer.Printers[Printer.PrinterIndex]
kexo

----- Original Message -----
From: "Vlastimil Zdenek" <delphi@gestore.cz>
To: <delphi-l@clexpert.cz>
Sent: Monday, November 10, 2003 12:03 PM
Subject: Re: Excel - tisk


> Diky. Vsechno vypada OK az na parametr "ActivePrinter". Jak ji zjistim??
>
> Vlasta
>
> ----- Original Message -----
> From: "kexo" <kexo@ynet.sk>
> To: <delphi-l@clexpert.cz>
> Sent: Monday, November 10, 2003 11:21 AM
> Subject: Re: Excel - tisk
>
>
> > Excel.ActiveWorksheet.Printout
> >






----------
* www.inMail.sk - Vasa emailova adresa na cely zivot ZDARMA
* Mail neobsahuje virusy. Zkontrolovane antivirusom NOD32 (www.eset.sk)
* www.SlovakNET.sk - profesionalny webhosting, domena .SK ZADARMO
* Zoner Media Explorer 5 - stiahnite si pomocnika pre digitalnu fotografiu
(zme.zoner.sk)

Odpovedá: Vlastimil Zdenek

10. 11. 2003 13:16

OK. Nemuzu vedet, na kterou tiskarnu to zakaznik posle a dalsi dialog je
nemozny.... Vyresil jsem to parametrem NULL, kdy si dohleda vychozi... 
mam jeste jeden problem. Excelovsky vytvareni dokument delam na pozadi
(vlastne neni vubec videt). Kdyz nastavim pri tisku, ze chci videt preview,
program vytuhne. Kdyz dam primi tisk, vse OK. Potrebuji ale videt i nahled a
pak se teprve rozhornout, jestli tisknout nebo ne. Co je pro preview nutny??
To musi byt videt vytvareny soubor xls aby se mi ukazalo preview?

Diky
Vlasta


----- Original Message -----
From: "kexo" <kexo@ynet.sk>
To: <delphi-l@clexpert.cz>
Sent: Monday, November 10, 2003 12:37 PM
Subject: Re: Excel - tisk


> je to textovy retazec - nazov tlaciarne na ktoru sa ma tlacit.
> inymi slovami, ked vyvolas TPrintDialog, alebo TPrinterSetupDialog, kde si
> nastavis vystupnu tlaciaren; tak nazov vybranej tlaciarne najdes v
> Printer.Printers[Printer.PrinterIndex]
> kexo
>
> ----- Original Message -----
> From: "Vlastimil Zdenek" <delphi@gestore.cz>
> To: <delphi-l@clexpert.cz>
> Sent: Monday, November 10, 2003 12:03 PM
> Subject: Re: Excel - tisk
>
>
> > Diky. Vsechno vypada OK az na parametr "ActivePrinter". Jak ji zjistim??
> >
> > Vlasta
> >
> > ----- Original Message -----
> > From: "kexo" <kexo@ynet.sk>
> > To: <delphi-l@clexpert.cz>
> > Sent: Monday, November 10, 2003 11:21 AM
> > Subject: Re: Excel - tisk
> >
> >
> > > Excel.ActiveWorksheet.Printout
> > >
>
>
>
>
>







----------
* www.inMail.sk - Vasa emailova adresa na cely zivot ZDARMA
* Mail neobsahuje virusy. Zkontrolovane antivirusom NOD32 (www.eset.sk)
* www.SlovakNET.sk - profesionalny webhosting, domena .SK ZADARMO
* Zoner Media Explorer 5 - stiahnite si pomocnika pre digitalnu fotografiu
(zme.zoner.sk)

Odpovedá: kexo

10. 11. 2003 13:40

nepovolujes zobrazenie suboru, resp. zosita, ale zobrazenie celej
aplikacie...
a teda ked mas aplikaciu skrytu, skryty je i preview.
mozes to vyriesit tak, ze nastavis okno excelu na minimized
(Application.WindowState := -4140), potom ho zobrazis, a ukazes preview
neskusal som, ale mohlo by to ist...
este moze potom vzniknut problem, ze kedy excel opat skryt (tj. po zatvoreni
preview)...s tymto ti teraz nepomozem, pohrab sa v helpe VBA, a ked na to
prides, napis  
kexo

----- Original Message -----
From: "Vlastimil Zdenek" <delphi@gestore.cz>
To: <delphi-l@clexpert.cz>
Sent: Monday, November 10, 2003 1:07 PM
Subject: Re: Excel - tisk


> OK. Nemuzu vedet, na kterou tiskarnu to zakaznik posle a dalsi dialog je
> nemozny.... Vyresil jsem to parametrem NULL, kdy si dohleda
vychozi... 
> mam jeste jeden problem. Excelovsky vytvareni dokument delam na pozadi
> (vlastne neni vubec videt). Kdyz nastavim pri tisku, ze chci videt
preview,
> program vytuhne. Kdyz dam primi tisk, vse OK. Potrebuji ale videt i nahled
a
> pak se teprve rozhornout, jestli tisknout nebo ne. Co je pro preview
nutny??
> To musi byt videt vytvareny soubor xls aby se mi ukazalo preview?
>
> Diky
> Vlasta






----------
* www.inMail.sk - Vasa emailova adresa na cely zivot ZDARMA
* Mail neobsahuje virusy. Zkontrolovane antivirusom NOD32 (www.eset.sk)
* www.SlovakNET.sk - profesionalny webhosting, domena .SK ZADARMO
* Zoner Media Explorer 5 - stiahnite si pomocnika pre digitalnu fotografiu
(zme.zoner.sk)